/**
 * This class contains unit tests for validating the behavior of Apex classes
 * and triggers.
 *
 * Unit tests are class methods that verify whether a particular piece
 * of code is working properly. Unit test methods take no arguments,
 * commit no data to the database, and are flagged with the testMethod
 * keyword in the method definition.
 *
 * All test methods in an organization are executed whenever Apex code is deployed
 * to a production organization to confirm correctness, ensure code
 * coverage, and prevent regressions. All Apex classes are
 * required to have at least 75% code coverage in order to be deployed
 * to a production organization. In addition, all triggers must have some code coverage.
 * 
 * The @isTest class annotation indicates this class only contains test
 * methods. Classes defined with the @isTest annotation do not count against
 * the organization size limit for all Apex scripts.
 *
 * See the Apex Language Reference for more information about Testing and Code Coverage.
 */
@isTest
private class triggerAndClassesTestClass1
{

    static testMethod void myUnitTest() 
    {
         string result = null;
        PageReference pageRef = null;
        List<String> resultList = null;
        
        //Country Object Record ...
        Country__c countryObject = new Country__c();
        countryObject.Is_Active__c = true;
        countryObject.Name = 'Test Country';
        insert countryObject;
                
        //Sub Activity Object Record...
        Sub_Activity__c subActivityObject = new Sub_Activity__c();
        subActivityObject.Activity_Type__c = 'Commercial';
        subActivityObject.Name = 'Test Activity';
        insert subActivityObject;
         
        //License Serial Object Record ...
        License_Serial__c serialObject = new License_Serial__c();
        serialObject.Status__c = 'Available';
        serialObject.Description__c = 'Test License Serial';
        insert serialObject;
        
        //For Service Pricebook Object Record...
        Service_Price_Book__c serviceObject = new Service_Price_Book__c();
        serviceObject.License_Application_Type__c = 'New License';
        serviceObject.License_App_Category__c = 'Trading - One Activity';
        serviceObject.isActive__c = true;
        //serviceObject.Fee
        insert serviceObject;
        
        //For Fees Object Records....
        Fee__c feeObject1 = new Fee__c();
        feeObject1.Name = 'Tenancy Delay Fee';
        feeObject1.Fee_Type__c = 'Tenancy Delay Fee';
        feeObject1.Price__c = 56;
        insert feeObject1;
        
        Fee__c feeObject2 = new Fee__c();
        feeObject2.Name = 'License Delay Fee';
        feeObject2.Fee_Type__c = 'License Delay Fee';
        feeObject2.Price__c = 56;
        insert feeObject2;
        
        Fee__c feeObject3 = new Fee__c();
        feeObject3.Name = 'Tenancy Delay Fee For Renewal';
        feeObject3.Fee_Type__c = 'Tenancy Delay Fee For Renewal';
        feeObject3.Price__c = 56;
        insert feeObject3;
        
        Fee__c feeObject4 = new Fee__c();
        feeObject4.Name = 'License Delay Fee For Renewal';
        feeObject4.Fee_Type__c = 'License Delay Fee For Renewal';
        feeObject4.Price__c = 56;
        insert feeObject4;
        
        Fee__c feeObject5 = new Fee__c();
        feeObject5.Name = 'Non Refundable';
        feeObject5.Fee_Type__c = 'Non Refundable';
        feeObject5.Price__c = 56;
        insert feeObject5;
        
        Fee__c feeObject6 = new Fee__c();
        feeObject6.Name = 'Guarantee';
        feeObject6.Fee_Type__c = 'Guarantee';
        feeObject6.Price__c = 56;
        insert feeObject6;
        
        Fee__c feeObject_Cancellation = new Fee__c();
        feeObject_Cancellation.Name = 'License Delay Fee For Cancellation';
        feeObject_Cancellation.Fee_Type__c = 'License Delay Fee For Cancellation';
        feeObject_Cancellation.Price__c = 56;
        insert feeObject_Cancellation;
        
        Service_Price_Book__c servicePriceBook_2 = new  Service_Price_Book__c();
        servicePriceBook_2.fee__c = feeObject5.id;
        servicePriceBook_2.License_Application_Type__c  = 'Application';//'New License';
        servicePriceBook_2.Visa_Category__c  = 'Passport - Passport Out'; 
        servicePriceBook_2.isActive__c = true;
        insert servicePriceBook_2;
        
        Service_Price_Book__c servicePriceBook_3 = new  Service_Price_Book__c();
        servicePriceBook_3.fee__c = feeObject6.id;
        servicePriceBook_3.License_Application_Type__c  = 'Application';//'New License';
        servicePriceBook_3.Visa_Category__c  = 'Passport - Passport Out'; 
        servicePriceBook_3.isActive__c = true;
        insert servicePriceBook_3;
        
        
        Service_Price_Book__c servicePriceBook_4 = new  Service_Price_Book__c();
        servicePriceBook_4.fee__c = feeObject5.id;
        servicePriceBook_4.License_Application_Type__c  = 'Tracking';//'New License';
        servicePriceBook_4.Visa_Category__c  = 'Passport - Passport Out';
        servicePriceBook_4.isActive__c = true; 
        insert servicePriceBook_4;
        
        Service_Price_Book__c servicePriceBook_5 = new  Service_Price_Book__c();
        servicePriceBook_5.fee__c = feeObject6.id;
        servicePriceBook_5.License_Application_Type__c  = 'Tracking';//'New License';
        servicePriceBook_5.Visa_Category__c  = 'Passport - Passport Out';
        servicePriceBook_5.isActive__c = true; 
        insert servicePriceBook_5;
        
        
        
        List<Service_Price_Book__c> serviceBookList = new List<Service_Price_Book__c>();
        List<string> serviceBookTypeList = new List<string>();
        
        serviceBookTypeList.add('Renewal');
        serviceBookTypeList.add('New License');
        serviceBookTypeList.add('Cancellation');
        serviceBookTypeList.add('Amendment');
        serviceBookTypeList.add('Renewal Additional');
        for(String tempString : serviceBookTypeList)
        {
            Service_Price_Book__c servicePriceBook1 = new  Service_Price_Book__c();
            servicePriceBook1.fee__c = feeObject1.id;
            servicePriceBook1.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook1.License_App_Category__c  = 'Trading - One Activity';  
            servicePriceBook1.isActive__c = true;     
                   
            Service_Price_Book__c servicePriceBook2 = new  Service_Price_Book__c();
            servicePriceBook2.fee__c = feeObject2.id;
            servicePriceBook2.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook2.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook2.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook3 = new  Service_Price_Book__c();
            servicePriceBook3.fee__c = feeObject3.id;
            servicePriceBook3.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook3.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook3.isActive__c = true;
            
                        
            Service_Price_Book__c servicePriceBook4 = new  Service_Price_Book__c();
            servicePriceBook4.fee__c = feeObject4.id;
            servicePriceBook4.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook4.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook4.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook5 = new  Service_Price_Book__c();
            servicePriceBook5.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook5.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook5.isActive__c = true;
            if(tempString == 'Cancellation')
            {
            	servicePriceBook5.fee__c = feeObject_Cancellation.id;
            
            }
            //For Non Refundable...
            Service_Price_Book__c servicePriceBook6 = new  Service_Price_Book__c();
            servicePriceBook6.fee__c = feeObject5.id;
            servicePriceBook6.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook6.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook6.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook7 = new  Service_Price_Book__c();
            servicePriceBook7.fee__c = feeObject5.id;
            servicePriceBook7.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook7.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook7.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook8 = new  Service_Price_Book__c();
            servicePriceBook8.fee__c = feeObject5.id;
            servicePriceBook8.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook8.License_App_Category__c  = 'Trading - One Activity';
            servicePriceBook8.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook9 = new  Service_Price_Book__c();
            servicePriceBook9.fee__c = feeObject5.id;
            servicePriceBook9.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook9.License_App_Category__c  = 'Trading - One Activity'; 
            servicePriceBook9.isActive__c = true;
            
            //For Locations....
            Service_Price_Book__c servicePriceBook10 = new  Service_Price_Book__c();
            servicePriceBook10.fee__c = feeObject5.id;
            servicePriceBook10.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook10.Location_Type__c = 'Guarantee';
            servicePriceBook10.License_App_Category__c  = 'Location'; 
            servicePriceBook10.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook11 = new  Service_Price_Book__c();
            servicePriceBook11.fee__c = feeObject5.id;
            servicePriceBook11.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook11.Location_Type__c = 'Land';
            servicePriceBook11.License_App_Category__c  = 'Location'; 
            servicePriceBook11.isActive__c = true;
            
            Service_Price_Book__c servicePriceBook12 = new  Service_Price_Book__c();
            servicePriceBook12.fee__c = feeObject5.id;
            servicePriceBook12.License_Application_Type__c  = tempString;//'New License';
            servicePriceBook12.Location_Type__c = 'Office';
            servicePriceBook12.License_App_Category__c  = 'Location'; 
            servicePriceBook12.isActive__c = true;
                       
            //Adding in the List...
            serviceBookList.add(servicePriceBook1);
            serviceBookList.add(servicePriceBook2);
            serviceBookList.add(servicePriceBook3);
            serviceBookList.add(servicePriceBook4);
            serviceBookList.add(servicePriceBook5);
            serviceBookList.add(servicePriceBook6);
            serviceBookList.add(servicePriceBook7);
            serviceBookList.add(servicePriceBook8);
            serviceBookList.add(servicePriceBook9);
            serviceBookList.add(servicePriceBook10);
            serviceBookList.add(servicePriceBook11);
            serviceBookList.add(servicePriceBook12);
            
        }
        
        //Now Insert the Service PriceBOok..
        insert serviceBookList;
        
        //For Location Object Records...
        Location__c locationObject = new Location__c();
        locationObject.Name = 'Test Office 112';
        locationObject.Location_Type__c = 'Office';
        locationObject.Rental_Rate__c = 18000;
        insert locationObject;
        
        //For Location Object Records...
        Location__c locationObject1 = new Location__c();
        locationObject1.Name = 'Test Office';
        locationObject1.Location_Type__c = 'Office';
        locationObject1.Rental_Rate__c = 18000;
        insert locationObject1;
        
        Location__c locationObject2 = new Location__c();
        locationObject2.Name = 'Test Land';
        locationObject2.Location_Type__c = 'Land';
        locationObject2.Rental_Rate__c = 18000;
        insert locationObject2;
        
        //Account Object Record...
        Account accountObject = new Account();
        accountObject.Name = 'Test Account';
        //accountObject.LicenseNumber__c = serialObject.id;
        accountObject.License_Application_Step__c = 'Record Created';
        accountObject.License_Application_Type__c = 'New License';
        accountObject.Activity__c = 'Trading - One Activity';
        accountObject.License_Issue_Date__c = system.today();
        accountObject.Master_Account_Flag__c = true;
        accountObject.License_Expiry_Date__c = System.Today().addYears(1);
        insert accountObject;
                    
        
        //For Chamber History Object...
        Chamber_History__c chamberObject = new Chamber_History__c();
        chamberObject.Company__c = accountObject.Id;
        chamberObject.Chamber_History_Status__c = 'Sent To Chamber';
        chamberObject.Chamber_Issue_Date__c = System.today();
        chamberObject.Chamber_Expiry_Date__c = System.today().addYears(1);
        chamberObject.Sent_to_Chamber_Date__c = System.today();
        insert chamberObject;
                
        //For Party Information Object Records...
        Party_Information__c partyObject1 = new Party_Information__c();
        partyObject1.First_Name__c = 'Test Manager';
        partyObject1.Last_Name__c = 'Test Manager';
        partyObject1.Role__c = 'Manager';
        partyObject1.Account__c = accountObject.Id;
        insert partyObject1;
        
        Party_Information__c partyObject2 = new Party_Information__c();
        partyObject2.First_Name__c = 'Test Shareholder';
        partyObject2.Last_Name__c = 'Test Shareholder';
        partyObject2.Role__c = 'Shareholder';
        partyObject2.Account__c = accountObject.Id;
        partyObject2.Ownership__c = 100;
        partyObject2.Share_Profit__c = 50;
        insert partyObject2;    
        
        //For Update to cover the Trigger..
        partyObject2.Share_Profit__c = 100;
        update partyObject2;
        
        
        
        //For Contact Object Records...
        Contact contactObject1 = new Contact();
        contactObject1.LastName = 'Test 1 Manager';
        contactObject1.AccountId = accountObject.id;
        contactObject1.Current_Employer__c =accountObject.id;
        contactObject1.Contact_Type__c = 'Manager';
        insert contactObject1;
        
        Contact contactObject2 = new Contact();
        contactObject2.LastName = 'Test 2 Shareholder';
        contactObject2.AccountId = accountObject.id;
        contactObject1.Current_Employer__c =accountObject.id;
        contactObject2.Contact_Type__c = 'Shareholder';
        insert contactObject2;
        
        //For Share Ownership Object Records...
        Share_Ownership__c shareOwnerObject1 = new Share_Ownership__c();
        shareOwnerObject1.Company__c = accountObject.Id;
        shareOwnerObject1.Shareholder__c = contactObject1.id;
        insert shareOwnerObject1;
        
        Share_Ownership__c shareOwnerObject2 = new Share_Ownership__c();
        shareOwnerObject2.Company__c = accountObject.Id;
        shareOwnerObject2.Ownership__c = 100;
        shareOwnerObject2.Share_Profit__c = 100;
        shareOwnerObject2.Shareholder__c = contactObject2.id;
        insert shareOwnerObject2;
        
        
        //For Account Activity Object Records...
        Account_Activity__c accountActivityObject = new Account_Activity__c();
        accountActivityObject.Account__c = accountObject.Id;
        accountActivityObject.Activity__c = subActivityObject.Id; 
        accountActivityObject.Active__c = true;
        insert accountActivityObject;
        
        //For Location booking Objects Records...
        Location_Booking_Information__c locationBookingObject1 = new Location_Booking_Information__c();
        locationBookingObject1.Account__c = accountObject.id;
        locationBookingObject1.Location__c = locationObject.Id;
        locationBookingObject1.License_Booking_Status__c = 'Booked';
        insert locationBookingObject1;
        
        Location_Booking_Information__c locationBookingObject2 = new Location_Booking_Information__c();
        locationBookingObject2.Account__c = accountObject.id;
        locationBookingObject2.Location__c = locationObject1.Id;
        locationBookingObject2.License_Booking_Status__c = 'Booked';
        insert locationBookingObject2;
        
        //For Suspension Object Records...
        Fines__c fineObject = new Fines__c();
        fineObject.Issue_Date__c = System.today();
        fineObject.Account__c = accountObject.id;
        fineObject.Fine_Type__c = 'Fix Amount';
        fineObject.Fine_Amount__c = 1000;
        fineObject.Fines_Included__c = true;
        fineObject.Status__c = 'Approved';
        insert fineObject;
        
        //For Invoice Object Records...
        //Put the Invoice Object in the list...
        List<string> invoiceObjectIdsList = new List<string>();
        
        Invoice__c invoiceObject = new Invoice__c();
        invoiceObject.Account__c = accountObject.id;
        invoiceObject.Date__c = System.Today();
        invoiceObject.Fee_Application_Type__c = 'New License';
        invoiceObject.Invoice_Type__c = 'New License';
        //Adding in the list...
        insert invoiceObject;
        
        invoiceObjectIdsList.add(invoiceObject.id);
        
        
        //For Invoice Line Item Object Records....
        Invoice_Line_Item__c invoiceItemObject1 = new Invoice_Line_Item__c();
        invoiceItemObject1.Amount__c = 67;
        invoiceItemObject1.Invoice__c = invoiceObject.id;
        invoiceItemObject1.Start_Date__c = System.Today();
        invoiceItemObject1.End_Date__c = System.today().addYears(1);
        insert invoiceItemObject1;
        
        Invoice_Line_Item__c invoiceItemObject2 = new Invoice_Line_Item__c();
        invoiceItemObject2.Amount__c = 67;
        invoiceItemObject2.Invoice__c = invoiceObject.id;
        invoiceItemObject2.Start_Date__c = System.Today().addYears(1);
        invoiceItemObject2.End_Date__c = System.today().addYears(2);
        invoiceItemObject2.Suspension__c = fineObject.id;
        insert invoiceItemObject2;
        
        //For Receipt Object Records...
        Receipt__c receiptObject = new Receipt__c();
        receiptObject.Company__c = accountObject.id;
        receiptObject.Total_Amount_on_Invoice__c = invoiceObject.Total_Invoice_Formula_Field__c;
        receiptObject.Receipt_Type__c = invoiceObject.Invoice_Type__c;
        receiptObject.Related_Invoice__c = invoiceObject.Id;
        receiptObject.Date__c = System.Today();
        insert receiptObject;
        
        Receipt__c receiptObject1 = new Receipt__c();
        receiptObject1.Company__c = accountObject.id;
        receiptObject1.Total_Amount_on_Invoice__c = invoiceObject.Total_Invoice_Formula_Field__c;
        receiptObject1.Receipt_Type__c = invoiceObject.Invoice_Type__c;
        receiptObject1.Related_Invoice__c = invoiceObject.Id;
        receiptObject1.Date__c = System.Today();
        insert receiptObject1;
        
        
        //For Payment Object Record...
        Payment__c paymentObject = new Payment__c();
        paymentObject.Amount__c = 1000;
        paymentObject.Receipt_ID__c = receiptObject.Id;
        paymentObject.Number__c = '12';
        paymentObject.Date__c = System.today();
        paymentObject.Bank_Name__c = 'Bank Al-Hilal';
        insert paymentObject;
        
        //For Payment Object Record...
        Payment__c paymentObject1 = new Payment__c();
        paymentObject1.Amount__c = 1000;
        paymentObject1.Receipt_ID__c = receiptObject1.Id;
        paymentObject1.Number__c = '12';
        paymentObject1.Date__c = System.today();
        paymentObject1.Bank_Name__c = 'Bank Al-Hilal';
        insert paymentObject1;
        
        //For Tenancy Object Records...
        RecordType recordType = [select Id,IsActive,SObjectType,DeveloperName from RecordType where DeveloperName = 'New_Tenancy_Contract' AND SObjectType = 'Tenancy_Contract__c'];
        Tenancy_Contract__c tenancyObject = new Tenancy_Contract__c();
        tenancyObject.Location__c = locationObject2.id;
        tenancyObject.RecordTypeId = recordType.id;
        tenancyObject.Tenant__c = accountObject.id;
        tenancyObject.Tenancy_Contract_Start_Date__c = accountObject.License_Issue_Date__c;
        tenancyObject.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject;
        
        //For Update the Location with the current Locaiton...
        locationObject2.Current_Tenancy_Contract__c = tenancyObject.Id;
        update locationObject2;
        
        RecordType rt = [select id,Name from RecordType where sObjectType=:'Application__c' and name =:'Employment'];  
    
        string recordType15DigitId =rt.Id;
    
        recordType15DigitId = recordType15DigitId.substring(0,recordType15DigitId.length()-3);
        
        Transaction_Types__c transactionType = new Transaction_Types__c();
        transactionType.Name = 'Passport - Passport Out';
        transactionType.Transaction_Type_ID__c = 'Passport - Passport Out';
        transactionType.Application_Record_Type__c = rt.Name;
        transactionType.Application_Record_Type_ID__c = recordType15DigitId;
        transactionType.Active__c = true;
        insert transactionType;
        
        
        /***************** For Trigger on the Account... ************/
        
        //Update the Tenancy Object...
        /*System.debug('The Cancellation Date => '+ tenancyObject.Tenancy_Contract_Cancellation_Date__c + '' );
        tenancyObject.Tenancy_Contract_Cancellation_Date__c = null;
        update tenancyObject;*/
        
        //Update the Account...
        //Account Object Record...
        Account accountObject1 = new Account();
        accountObject1.Name = 'Test Account';
        accountObject1.License_Application_Step__c = 'Renewal Started';
        //accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        accountObject1.License_Application_Type__c = 'Renewal';
        accountObject1.Activity__c = 'Trading - One Activity';
        accountObject1.License_Issue_Date__c = system.today();
        accountObject1.License_Expiry_Date__c = System.Today().addYears(1);
        accountObject1.Master_Account_Flag__c  = true;
        
        User userObject = [select Id from User LIMIT 1];
        accountObject1.Record_Approver_Id__c = userObject.id;
        
        insert accountObject1;
        
        Location__c locationObject3 = new Location__c();
        locationObject3.Name = 'Test Land3 ';
        locationObject3.Location_Type__c = 'Land';
        locationObject3.Rental_Rate__c = 18000;
        insert locationObject3;
        
        Tenancy_Contract__c tenancyObject2 = new Tenancy_Contract__c();
        tenancyObject2.Location__c = locationObject3.id;
        tenancyObject2.RecordTypeId = recordType.id;
        tenancyObject2.Tenant__c = accountObject1.id;
        tenancyObject2.Tenancy_Contract_Start_Date__c = accountObject1.License_Issue_Date__c;
        tenancyObject2.Tenancy_Contract_Expiry_Date__c = date.TODAY().addyears(1).adddays(-1);
        insert tenancyObject2;
        
        //For Update the Location with the current Locaiton...
        locationObject3.Current_Tenancy_Contract__c = tenancyObject2.Id;
        update locationObject3;
        
        //Now Update the Account Object...
        accountObject1.License_Application_Step__c = 'Approved by Immigration User';
        update accountObject1;
        
        System.debug('The Account Object 1 Id in test => '+ accountObject1.Id);
        accountObject1.License_Application_Step__c = 'Submitted for Maintenance Department User Approval';
        update accountObject1;
        
        
        Map<string,RecordType> amendmentRecordTypeMap = new Map<string,RecordType>();
        for(RecordType tempObject : [SELECT Id,SObjectType,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' AND IsActive =: true])
        {
            amendmentRecordTypeMap.put(tempObject.DeveloperName, tempObject);
            
        }
        
        
        //For Amendment Object For Company Name...
        Amendment__c amendmentObject = new Amendment__c();
        amendmentObject.RecordTypeId = amendmentRecordTypeMap.get('Company_Amendment_Change_Company_Name').Id;
        amendmentObject.Account__c = accountObject1.Id;
        amendmentObject.New_Company_Name__c = 'Test New Name';
        amendmentObject.New_Company_Name_Arabic__c = 'test New Name Arabic';
        //amendmentObject.Chamber_History__c = chamberObject.id;
        insert amendmentObject;
    
    	 /******************* Calling Classes to cover the test Cassess ************/
    	 
    	  ApexPages.StandardController accountExtendedObject = new ApexPages.StandardController(accountObject);
        ApexPages.CurrentPage().getParameters().put('id',accountObject.id);
        ApexPages.StandardController tenancyExtendedObject = new ApexPages.StandardController(tenancyObject);
        ApexPages.StandardController invoiceExtendedObject = new ApexPages.StandardController(invoiceObject);
        ApexPages.StandardController receiptExtendedObject = new ApexPages.StandardController(receiptObject);
        ApexPages.StandardController receiptExtendedObject1 = new ApexPages.StandardController(receiptObject1);
                
        //For ext_OfficialApplicationForm Class Test Coverage...
        ext_OfficialApplicationForm officialClass = new ext_OfficialApplicationForm(accountExtendedObject);
        
        //For extensionControllerClass Class Test Coverage...
        extensionControllerClass accountExtensionClass = new extensionControllerClass(accountExtendedObject);
        accountExtensionClass.generateOfficialAppFormMethod();
        accountExtensionClass.generatingLicensePDF();
        accountExtensionClass.generatingArticleOfAssociationPDF();
        
        
        //For Chamber History PDF...
        ApexPages.StandardController accountExtendedObject1 = new ApexPages.StandardController(accountObject1);
        ApexPages.CurrentPage().getParameters().put('id',accountObject1.id);
        ApexPages.CurrentPage().getParameters().put('amendmentId',amendmentObject.id);
        ApexPages.CurrentPage().getParameters().put('activity','activity');
        ApexPages.CurrentPage().getParameters().put('partner','partner');
        extensionControllerClass accountExtensionClass1 = new extensionControllerClass(accountExtendedObject1);
        accountExtensionClass1.generatingChamberPDFMethod();
        
        //Change the Current Page id to Invoice Id...
        ApexPages.CurrentPage().getParameters().put('id',invoiceObject.id);
        extensionControllerClass invoiceExtensionClass = new extensionControllerClass(invoiceExtendedObject);
        invoiceExtensionClass.generateInvoicePDFMethod();
        
        //Change the Current Page Id to Tenancy Contract Id...
        ApexPages.CurrentPage().getParameters().put('id',tenancyObject.id);
        extensionControllerClass tenancyExtensionClass = new extensionControllerClass(tenancyExtendedObject);
        tenancyExtensionClass.generatingAccountTenancyContractPDF();
        
        //Change the Current Page id to Receipt Id...
        ApexPages.CurrentPage().getParameters().put('id',receiptObject.id);
        extensionControllerClass receiptExtensionClass = new extensionControllerClass(receiptExtendedObject);
        receiptExtensionClass.generateReceiptViewerMethod();
        receiptExtensionClass.generatePaymentModule();
        receiptExtensionClass.additems();
        receiptExtensionClass.RowIndex = 'j_id0:MainForm:j_id50:0:j_id52:0:EDITID';//paymentObject.Id;
        receiptExtensionClass.receiptBalance = 100;
        receiptExtensionClass.EditAllow();
        result = receiptExtensionClass.updateitemlist();
        //receiptExtensionClass.cancelEdit();
        
        
        pageRef = receiptExtensionClass.ProceedToNextStep();
        pageRef = receiptExtensionClass.redirectToReceiptPage();
        
		//Negative Test Cases...
        ApexPages.CurrentPage().getParameters().put('id',receiptObject1.id);
        extensionControllerClass receiptExtensionClass1 = new extensionControllerClass(receiptExtendedObject1);
        receiptExtensionClass1.receiptBalance = 1000;
        receiptExtensionClass1.generatePaymentModule();
        receiptExtensionClass1.RowIndex = 'j_id0:MainForm:j_id50:0:j_id52:0:EDITID';//paymentObject.Id;
        receiptExtensionClass1.DelAllow();
        receiptExtensionClass1.cancelEdit();
        
        //For issueRecieptAndInvoiceClass Class Test Coverage...
        result = issueRecieptAndInvoiceClass.validateInvoiceAndLineItemMethod(accountObject.id); 
        result = issueRecieptAndInvoiceClass.releaseLocationSetupMethod(accountObject.id,'Cancellation');
        //result = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id);
        //resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License');
        resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License', 'Account', accountObject.id);
        resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License', 'Application', accountObject.id);
        resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License', 'Tracking', accountObject.id);
        resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License', 'Tenancy', accountObject.id);
        resultList = issueRecieptAndInvoiceClass.validateReceiptCreationMethod(accountObject.id,'New License', 'Amendment', accountObject.id);
        resultList = issueRecieptAndInvoiceClass.generatingInvoiceAndLineItemForNewLicenseMethod(accountObject.Id,accountObject.License_Application_Type__c,accountObject.Activity__c,'False',null);
        string popDate  = string.valueof(accountObject.License_Expiry_Date__c); 
        popDate = string.valueOf(popDate.split('-')[2]+'/'+popDate.split('-')[1]+'/'+popDate.split('-')[0]);
    
    
    
    
    }
}